home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / CUJ9102.ARJ / 9N02099A < prev    next >
Text File  |  1992-07-06  |  812b  |  27 lines

  1.  
  2.  
  3. void main(void)
  4. {
  5. char b[32];                               // Buffer for user input
  6. int size;                                 // Symbol size
  7. int i;                                    // Loop counter
  8. union                                     // Space for test symbol
  9.   {
  10.   SYMBOL x;
  11.   char y[sizeof(SYMBOL)+255];
  12.   } sym;
  13.  
  14. memset(&sym,0,sizeof(sym));               // Clear symbol area
  15. printf("Symbol size? ");                  // Get symbol size from user
  16. gets(b);
  17. size = atoi(b);
  18. if(size < 0) size = 0;                    // Make sure size is in bounds
  19. if(size > 255) size = 255;
  20. memset(sym.x.symbol,'X',size);            // Set symbol to X's
  21.  
  22. for(i = 0; savesym(&sym.x) != NULL; i++); // Allocate all memory
  23. printf("\n%d symbols allocated\n",i);     // Print number of symbols
  24. }
  25.  
  26.  
  27.